/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.brainstretch.models.actions;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import org.brainstretch.models.User;
import org.brainstretch.models.UserAction;
import org.brainstretch.models.quizzes.Quiz;

/**
 *
 * @author mrodaitis
 */
@Entity
public class Rating extends UserAction implements Serializable {
    private static final long serialVersionUID = 1L;

    
    private int rating;
    
    @ManyToOne
    private Quiz quiz;

    public Rating() {
        super();
    }

    public Rating(int value, Quiz quiz, User user) {
        super(user);
        this.rating = value;
        this.quiz = quiz;
    }

    public Quiz getQuiz() {
        return quiz;
    }

    public void setQuiz(Quiz quiz) {
        this.quiz = quiz;
    }

    public int getRating() {
        return rating;
    }

    public void setRating(int value) {
        this.rating = value;
    }
  
    @Override
    public String toString() {
        return "org.brainstretch.models.actions.Rating[ id=" + getId() + " ]";
    }
    
}
